package com.keyin;

import java.util.Timer;
import java.util.TimerTask;

import android.content.Intent;
import android.os.Bundle;
import android.view.Window;

import com.keyin.protocol.CacheImageProtocol;

public class Logo extends BaseActivity {

	/**
	 * http://www.keyin.cn/ipad/new_magazines.php
	 * 
	 * 
	 * http://www.keyin.cn/ipad/magazines_list.php 这个是 的数据 里面有中文，如果有字符集的问题我再修改
	 * 
	 * http://www.keyin.cn/ipad/get_magazines_list.php?magazine_id=517&
	 * page_index=1&page_size=20 这个是2.3 某本杂志的期刊列表
	 * 
	 * '515','516','517','518','519','520','521' 只有这六本
	 */

	private static final Object lock = new Object();

	private static final int WAIT_TIME = 2000;
	
	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);

		requestWindowFeature(Window.FEATURE_NO_TITLE);
		setContentView(R.layout.a_logo);
		
		new CacheImageProtocol(getApplicationContext(), null);
		
		new Timer().schedule(new TimerTask() {
			@Override
			public void run() {
				try {
					synchronized (lock) {
						lock.wait(WAIT_TIME);
					}
					nextActivity();
				} catch (Exception e) {
					e.printStackTrace();
				} finally {
				}
			}
		}, 20);
	}
	
	private void nextActivity() {
		Intent i = new Intent(Logo.this, Main.class);
		startActivity(i);
		finish();
	}
}